<template>
  <h6 style="color: crimson">商品与赠品管理--><a href="http://localhost:5173/gift">赠品管理</a>-->查看赠品详情</h6>
        赠品名称:  <br>{{giftDetail.gname}}
   <hr> 赠品类型:  <br>{{giftDetail.gtype}}
   <hr> 赠品型号:  <br>{{giftDetail.gmodel}}
   <hr> 赠品单价:  <br>{{giftDetail.marketPrice}}
   <hr> 采购成本:  <br>{{giftDetail.purchasePrice}}
   <hr> 最低库存量: <br>{{giftDetail.minStock}}
   <hr> 赠品颜色:  <br>{{giftDetail.gcolor}}
   <hr> 赠品品牌:  <br>{{giftDetail.gbrand}}
</template>

<script setup>
import {ref,reactive,onMounted,getCurrentInstance} from "vue";
import axios from "@/plugins/axios.js";
import {ElMessage} from "element-plus";
import router from "@/router/index.js";
import {giftStore} from "@/stores/GiftModel.js";
const giftModel = giftStore();

const giftDetail =ref({
  gname: "",
  gtype: "",
  gmodel: "",
  marketPrice: "",
  purchasePrice: "",
  minStock: "",
  gcolor: "",
  gbrand: "",
})
onMounted(() => {
  console.log(giftModel.$id);
  const id=giftModel.$id;
  console.log(id);
  axios.get("/gift/getGiftDetail/"+id).then((res) => {

    if (res.code === 200){
      console.log(res.data);
      giftDetail.value=res.data;
      console.log(giftDetail.value);

    }

  });
});

</script>

<style >

</style>